export default function changeName(show, inputType, flagList) {
  const getMatInfor = (shows, inputTypes, flagLists) => {
    shows.forEach(item => {
      const newItem = item;
      // 文本类型
      inputTypes.forEach(c => {
        if (Number(item.inpType) === Number(c.itemCode)) {
          newItem.inpTypeName = c.itemName;
        }
      });
      // 是否支持判断 与 显示逻辑
      flagLists.forEach(flagItem => {
        if (Number(item.judgeFlag) === Number(flagItem.itemCode)) {
          newItem.judgeFlagName = flagItem.itemName;
        }
      });
      if (item.children) {
        getMatInfor(item.children, inputType, flagList);
      }
    });
  };
  getMatInfor(show, inputType, flagList);

  return show;
}
